package edu.gatech.cs2340.group7.wheresmystuffapp.presenters;

import android.content.Intent;
import edu.gatech.cs2340.group7.wheresmystuffapp.model.Account;
import edu.gatech.cs2340.group7.wheresmystuffapp.model.DataManager;
import edu.gatech.cs2340.group7.wheresmystuffapp.views.UserMainMenuView;

public class UserMainMenuPresenter {
	private UserMainMenuView view;

	public UserMainMenuPresenter(UserMainMenuView v) {
		view = v;
	}

	/**
	 * Takes the user to a page that will allow them to report a lost item
	 * @param intent
	 */
	public void reportLostItem(Intent intent) {
		view.startActivity(intent);
	}

	/**
	 * Takes the user to a page that will allow them to report a found item
	 * @param intent
	 */
	public void reportFoundItem(Intent intent) {
		view.startActivity(intent);
	}

	/**
	 * Takes the user to a page that displays the items that they have registered
	 * @param intent
	 */
	public void showReportedItems(Intent intent) {
		view.startActivity(intent);
	}

	/**
	 * Logs the user out
	 * @param intent
	 */
	public void logout(Intent intent) {
		Account a = DataManager.getCurrentAccount();
		a.setLoginAttempts(0);
		DataManager.setCurrentAccount(null);
		view.startActivity(intent);
	}

	/**
	 * Takes the user to their account information page
	 * @param intent
	 */
	public void showAccountInfo(Intent intent) {
		view.startActivity(intent);
	}

	/**
	 * Takes them to a page where they can search for items
	 * @param intent
	 */
	public void showSearchPage(Intent intent) {
		view.startActivity(intent);
	}

	/**
	 * Takes the user to a page that will display their matched items
	 * @param intent
	 */
	public void showMatchedItems(Intent intent) {
		view.startActivity(intent);
	}

	public void showOldestItem(Intent intent) {
		view.startActivity(intent);		
	}

}
